import request from '@/config/axios'

// 日程安排 VO
export interface ScheduleArrangementVO {
  id: number // 主键ID
  scheduleTimeRange: string // 日程时间范围
  startTime: localtime // 开始时间
  endTime: localtime // 结束时间
  scheduleContent: string // 日程内容
  priorityLevel: string // 优先级
  reminderSetting: boolean // 提醒设置(0:不提醒,1:提醒)
  scheduleDescription: string // 日程详细描述
}

// 日程安排 API
export const ScheduleArrangementApi = {
  // 查询日程安排分页
  getScheduleArrangementPage: async (params: any) => {
    return await request.get({ url: `/oa/schedule-arrangement/page`, params })
  },

  // 查询日程安排详情
  getScheduleArrangement: async (id: number) => {
    return await request.get({ url: `/oa/schedule-arrangement/get?id=` + id })
  },

  // 新增日程安排
  createScheduleArrangement: async (data: ScheduleArrangementVO) => {
    return await request.post({ url: `/oa/schedule-arrangement/create`, data })
  },

  // 修改日程安排
  updateScheduleArrangement: async (data: ScheduleArrangementVO) => {
    return await request.put({ url: `/oa/schedule-arrangement/update`, data })
  },

  // 删除日程安排
  deleteScheduleArrangement: async (id: number) => {
    return await request.delete({ url: `/oa/schedule-arrangement/delete?id=` + id })
  },

  // 导出日程安排 Excel
  exportScheduleArrangement: async (params) => {
    return await request.download({ url: `/oa/schedule-arrangement/export-excel`, params })
  }
}